package com.kgc.novel.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 支付表
 * </p>
 *
 * @author jcq
 * @since 2023-05-17
 */
@Getter
@Setter
@Api(tags = "支付类")
@TableName("book_payment")
public class BookPayment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 支付主键id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 用户id，关联用户表
     */
    @ApiParam("用户id")
    @TableField("user_id")
    private String userId;

    /**
     * 订单id，关联订单表
     */
    @ApiParam("订单id")
    @TableField("order_id")
    private String orderId;

    /**
     * 支付金额；关联折扣表的价格
     */
    @ApiParam("支付金额")
    @TableField("amount")
    private BigDecimal amount;

    /**
     * 支付方式 1：抖音支付；2：支付宝支付；3：微信支付
     */
    @ApiParam("支付方式")
    @TableField("payment_method")
    private String paymentMethod;

    /**
     * 支付时间
     */
    @ApiParam("支付时间")
    @TableField("payment_time")
    private LocalDateTime paymentTime;

    /**
     * 支付状态；0：已支付；1：待支付；2：已退款
     */
    @ApiParam("支付状态")
    @TableField("status")
    private Boolean status;

    /**
     * 退款金额
     */
    @ApiParam("退款金额")
    @TableField("refund_amount")
    private BigDecimal refundAmount;

    /**
     * 退款时间
     */
    @ApiParam("退款时间")
    @TableField("refund_time")
    private LocalDateTime refundTime;

    /**
     * 备注
     */
    @ApiParam("备注")
    @TableField("remark")
    private String remark;


    /**
     * 是否删除
     */
    @ApiParam("是否删除")
    @TableField("deleted")
    @TableLogic
    private Boolean deleted;

    /**
     * 创建时间
     */
    @ApiParam("创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @ApiParam("修改时间")
    @TableField(value = "update_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
}
